from appium import webdriver
def init_driver():
    '''
    # server 启动参数
    caps = {}
    caps["platformName"] = "Android"
    caps["platformVersion"] = "5.1.1"
    caps["deviceName"] = "Mi_Note_3"
    caps["appPackage"] = "com.baidu.BaiduMap"
    # caps["appActivity"] = "com.baidu.baidumaps.guide.NewGuideScreen"
    caps["appActivity"] = "com.baidu.baidumaps.WelcomeScreen"
    caps['noReset'] = True
    caps["resetKeyboard"] = True
    caps["unicodeKeyboard"] = True
    caps["automationName"] = "UiAutomator1"
    '''
    # 指定设备信息
    device = {}
    device['deviceName'] = '127.0.0.1:62001'
    device['platformName'] = 'Android'
    device['platformVersion'] = '5.1.1'
    device['appPackage'] = 'com.zzwl.zxm.test'
    device['appActivity'] = 'com.uzmap.pkg.LauncherUI'
    device['appWaitActivity'] = 'com.uzmap.pkg.EntranceActivity'
    device['noReset'] = True
    device['unicodeKeyboard'] = True
    device['resetKeyboard'] = True
    device["automationName"] = "UiAutomator1"

    # 声明我们的driver对象
    return webdriver.Remote('http://127.0.0.1:4723/wd/hub', device)

if __name__ == '__main__':
    init_driver()